<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="cn.biwysh.exam.entity.Notice"%>
<%@ page import="cn.biwysh.exam.entity.User"%>
<%@ page import="cn.biwysh.exam.util.MyStringTools"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	List<Notice> imglist=null;
	List<Notice> guo=null;
	List<Notice> sheng=null;
	List<Notice> shi=null;
	Date now=new Date();
	 Calendar  c = Calendar.getInstance();   
	 c.set((now.getYear()+1900),now.getMonth(),now.getDate(),0,0,0);
	 c.add(Calendar.DAY_OF_MONTH, -1);
	 now=c.getTime();
	if(request.getAttribute("imglist")!=null){
		imglist=(List<Notice>)request.getAttribute("imglist");
	}
	if(request.getAttribute("guo")!=null){
		guo=(List<Notice>)request.getAttribute("guo");
	}
	if(request.getAttribute("sheng")!=null){
		sheng=(List<Notice>)request.getAttribute("sheng");
	}
	if(request.getAttribute("shi")!=null){
		shi=(List<Notice>)request.getAttribute("shi");
	}
	User user=null;
	int uid=0;
	if (session.getAttribute("userqt") != null) {
		user = (User) session.getAttribute("userqt");
		uid=user.getId();
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>首页</title>
		<link href="css/qt/index.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src='dwr/engine.js'>
        </script>
		<script type="text/javascript" src='dwr/util.js'>
        </script>
		<script type="text/javascript" src="script/jquery/jquery-1.5.1.min.js">
        </script>
        <script type="text/javascript" src='dwr/interface/IndexDwr.js'>
        </script>
        <script type="text/javascript" src="script/util.js">
        </script>
        <script type="text/javascript" src="script/qt/index.js">
        </script>
		<script type="text/javascript">
		  var uid=<%=uid%>;
		  var count=0;
		  var m=0;
		  var list;
		</script>
		<script type="text/javascript">  
		    var isIE = !!window.ActiveXObject;  
		    var isIE6 = isIE && !window.XMLHttpRequest;  
  
       </script> 
</head>
  
  <body>
     <div id="mainleft"><img src="img/qt/mainleft.jpg" style="width:100%;height:100%;"/></div>
     <div id="main">
       <div id="top">
           <jsp:include page="title.jsp" flush="true">
             <jsp:param name="jspName" value="index" />
           </jsp:include>
           <div class="clear"></div>
       </div>
       <div id="notice">
         <div id="not1"></div>
         <div id="not2">
             <div id="nottitle">电力通告</div>
             <div class="clear"></div>
             <div id="notall">
               <div id="banner">	
					<div id="banner_bg"></div>  <!--标题背景-->
					<div id="banner_info"></div> <!--标题-->
				    <ul>
				        <%if(imglist!=null){%>
					        <%for(int i=0;i<imglist.size();i++){ %>
					        <%	   if(i==0){ %>
					            	<li class="on">1</li>
					        <%    }else{ %>
					        	     <li><%=(i+1) %></li>
					        <%    }%>
					         <%} %>
				         <%}else{ %>
				            	<li class="on">1</li>
				         <%} %>
				    </ul>
				   <div id="banner_list">
				          <%if(imglist!=null){%>
					        <%for(int i=0;i<imglist.size();i++){ %>
				              <a href="tgdetail.do?nid=<%=imglist.get(i).getId() %>" target="_blank"><img src="upload/tonggao/<%=imglist.get(i).getImgurl() %>" title="<%=imglist.get(i).getTitle() %>" alt="<%=MyStringTools.bSubstring(imglist.get(i).getTitle(),32) %>" /></a>
				            <%} %>
				         <%}else{ %>
				              <a href="#" target="_blank"><img src="img/p1.jpg" title="请添加通告" alt="请添加通告" /></a>
				         <%} %>
					</div>
				</div>
				<div id="tonggao">
				   <div id="tong1">
				   
				   </div>
				   <div id="tong2">
				   	 <div id="tong21">
				      <div id="tongtitle">
				        <table cellpadding="0" cellspacing="0" style="float:left;margin:0px;">
				          <tr>
				           <td id="nva1" onclick="ChengeNav('nva1')" class="default"></td>
				           <td id="nva2" onclick="ChengeNav('nva2')" class="button"></td>
				           <td id="nva3" onclick="ChengeNav('nva3')" class="button"></td>
				           <td id="nvamore" style="width:210px;text-align:right;padding:8px 0 0 0;">
				            <a id="tgmore"  target="_blank"  href="tglist.do?type=1"><img alt="" style="border:0px;" src="img/qt/gengduo.jpg"/></a>
				           </td>
				          </tr>
				        </table>
				      </div>
				      <div id="tongmain">
					      <table id="guo" cellpadding="0" cellspacing="0" style="float:left;margin:0px;">
					          <%if(guo!=null){%>
						        <%for(int i=0;i<guo.size();i++){ %>
					             <tr>
						           <td class="dot"></td>
						           <td class="title">
						            <a href="tgdetail.do?nid=<%=guo.get(i).getId() %>" target="_blank"><%=MyStringTools.bSubstring(guo.get(i).getTitle(),52) %></a>
						           </td>
						           <td class="img">
						            <%if(guo.get(i).getAddtime().after(now)) {%>
						              <img alt="" src="img/qt/new.jpg">
						             <%}%>
						           </td>
						          </tr>
					            <%} %>
					         <%} %>
					       </table>
					        <table id="sheng" cellpadding="0" cellspacing="0" style="float:left;margin:0px;display: none;">
					           <%if(sheng!=null){%>
						        <%for(int i=0;i<sheng.size();i++){ %>
					             <tr>
						           <td class="dot"></td>
						           <td class="title">
						            <a href="tgdetail.do?nid=<%=sheng.get(i).getId() %>" target="_blank"><%=MyStringTools.bSubstring(sheng.get(i).getTitle(),52) %></a>
						           </td>
						           <td class="img">
						            <%if(sheng.get(i).getAddtime().after(now)) {%>
						              <img alt="" src="img/qt/new.jpg">
						             <%}%>
						           </td>
						          </tr>
					            <%} %>
					         <%} %>
					       </table>
					        <table id="shi" cellpadding="0" cellspacing="0" style="float:left;margin:0px; display: none;">
					           <%if(shi!=null){%>
						        <%for(int i=0;i<shi.size();i++){ %>
					             <tr>
						           <td class="dot"></td>
						           <td class="title">
						            <a href="tgdetail.do?nid=<%=shi.get(i).getId() %>" target="_blank"><%=MyStringTools.bSubstring(shi.get(i).getTitle(),52) %></a>
						           </td>
						           <td class="img">
						            <%if(shi.get(i).getAddtime().after(now)) {%>
						              <img alt="" src="img/qt/new.jpg">
						             <%}%>
						           </td>
						          </tr>
					            <%} %>
					         <%} %>
					       </table>
				      </div>
					 </div>
					</div>
					<div id="tong3">
					   
					</div>
				</div>
             </div>
         </div>
         <div id="not3"></div>
       </div>
       <div id="zhishi">

       </div>
       <div class="clear">
       </div>
       <div id="bigmore">
         <img alt="" id="line" src="img/qt/line.jpg" style="float:left;margin:10px 0 0 30px;">
         <div style="float:left;color：#6E9BBA; margin-left:40px;">
           <img src="img/qt/bgmorezuo.jpg"/>
           <a href="zsmore.do" target="_blank" style="color:#6E9BBA;">更多知识</a>
           <img src="img/qt/bgmoreyou.jpg"/>
         </div>
          <img alt="" src="img/qt/line.jpg" style="float:left;margin:10px 0 0 40px;">
       </div>
       <div id="footer">
		  <jsp:include page="footer.jsp" flush="true"></jsp:include>
	   </div>
     </div>
     <div id="mainright"><img src="img/qt/mainright.jpg" style="width:100%;height:100%;"/></div>
  </body>
</html>
